package com.youbo.config;


import com.sccba.open.api.OpenAPI;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

/**
 * 配置文件
 */
@Data
@Configuration
public class ProjectConfig {

    public static String ACCESS_TOKEN=null;
    public static Date ACCESS_EXPIRESDATE=null;

    public static String REFRESH_TOKEN=null;
    public static Date REFRESH_TOKEN_EXPIRESDATE=null;


    private  OpenAPI open;

    @Value("${projectConfig.configFilePath}")
    private String configFilePath;
    @Value("${projectConfig.baseUrl}")
    private String baseUrl;
    @Value("${projectConfig.tokenUrl}")
    private String tokenUrl;

    @Value("${projectConfig.bankId}")
    private String bankId;
    @Value("${projectConfig.yybs}")
    private String yybs;
    @Value("${projectConfig.cpdm}")
    private String cpdm;

    @Value("${projectConfig.appId}")
    private String appId;
    @Value("${projectConfig.secret}")
    private String secret;
    @Value("${projectConfig.secretKey}")
    private String secretKey;
    @Value("${projectConfig.mchntCd}")
    private String mchntCd;

    @Value("${projectConfig.orderLife}")
    private String orderLife;

    @Value("${projectConfig.notifyUrl}")
    private String notifyUrl;




    public OpenAPI getInstanceOpenAPI() throws Exception {
        if(null==open){
            open = new OpenAPI(getConfigFilePath());
        }
        return open;
    }


}
